<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            height: 50px;
            font-size: 30px;
            color: red;
            background: greenyellow;
        }
    </style>
</head>
<body>

    <!-- 
        navigator  userAgent  存储客户端的一些信息(操作系统平台，浏览器版本)
                浏览器一般会把这个userAgent的信息发个服务器
     -->
     <div>
        电脑端
     </div>
    <script>
        var userAgent=navigator.userAgent;
        var language=navigator.language;
        if(userAgent.match(/(iPhone)|iPod|iPad|Android|Mobile/i)){
            location.assign('16.mobile.html')
        }
        var navobj=navigator.userAgent
        console.log(navobj);

        

    </script>
    
</body>
</html>